/*
<Copyright (C) 2011 Dru Moore>

This file is part of demorecorder.

vlc-remote is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

demorecorder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with demorecorder.  If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import com.meego 1.0

Item {
    id: root
    property double volume: 1.0
    property double panorama: 0.0
    property bool mute: false
    property string name: "unknown"

    signal volumeChanged(double volume)
    signal panoramaChanged(double panorama)
    signal closeClicked()

    Rectangle {
        color: "black"
        anchors.fill: parent
        radius: 8
        border.color: "#ffffff"
        border.width: 2
        opacity: 0.8
    }

    Grid {
        id:  layoutGrid
        columns: 3
        rows: 2
        spacing: 4
        anchors.fill: parent

        Label {
            text:  qsTr("Volume")
            color: "white"
            width: 120
            verticalAlignment: "AlignVCenter"
            horizontalAlignment: "AlignRight"
        }
        Slider {
            id: sliderVolume
            stepSize: 0.1
            minimumValue: 0.0
            maximumValue: 10.0
            valueIndicatorVisible: true
            width: 300
            height: 48
            value: volume
            onPressedChanged: {
                if (!pressed) {
                    volume = value;
                    volumeChanged(value);
                }
            }
        }
        Button {
            id: buttonClose
            width: 36
            height: 36
            text: "x"
            onClicked: {
                closeClicked();
            }
        }


        Label {
            text:  qsTr("Panorama")
            color: "white"
            width: 120
            verticalAlignment: "AlignVCenter"
            horizontalAlignment: "AlignRight"
        }
        Slider {
            id: sliderPanorama
            stepSize: 0.1
            minimumValue: -1.0
            maximumValue: 1.0
            valueIndicatorVisible: true
            width: 300
            height: 48
            value: panorama

            onPressedChanged: {
                if (!pressed) {
                    panorama = value;
                    panoramaChanged(value);
                }
            }
        }

    } // end grid

} // end item
